package com.wanban.downloader.model;


import androidx.annotation.NonNull;


import java.io.Serializable;
import java.util.ArrayList;

public class M3U8 implements Serializable {
    public String url;
    public String videoName;
    public String finalUrl;
    public String errorMsg;
    public boolean success;
    public int version;
    public int sequence;
    public int errorCode;
    public float targetDuration;
    public boolean isM3U8;
    public boolean hasEndList;
    public ArrayList<M3U8Seg> tsList;
    // 二级请求列表
    public ArrayList<M3U8Stream> streams;


    public M3U8(){
        tsList = new ArrayList<>();
    }

    public M3U8(String url){
        this.url = url;
        tsList = new ArrayList<>();
    }


    public void addTs(M3U8Seg ts){
        tsList.add(ts);
    }

    public void setErrorMessage(String msg){
        success = false;
        errorMsg = msg;
    }

    @NonNull
    @Override
    public String toString() {


        return super.toString();
    }
}
